import axios from "axios"
const root = "http://localhost:8080/api"

const url = {
    searchMusic: root + "/search",
    palyMusicApi:root + "/song/urls",
    categoryApi:root + "/top/category",//获取榜单
    dailyApi:root + "/recommend/daily",//获取每日推荐
    songInformation: root + "/song" ,//单个音乐信息
    getLyric: root + "/lyric", //音乐歌词
    getAlbum: root + "/album" //专辑信息
}

const musicApi = {
    searchMusic(params){
        return axios.get(url.searchMusic,{params})
    },
    palyMusicApi(params){
        return axios.get(url.palyMusicApi,{params})
    },
    categoryApi(params){
        return axios.get(url.categoryApi,{params})
    },
    dailyApi(params){
        return axios.get(url.dailyApi,{params})
    },
    songInformation(params){
        return axios.get(url.songInformation,{params})
    },
    getLyric(params){
        return axios.get(url.getLyric,{params})
    },
    getAlbum(params){
        return axios.get(url.getAlbum,{params})
    },
}

export default musicApi